package com.order.enums;

public enum PaymentType {
    ALIPAY(1,"zfb", "支付宝"),
    WECHAT(2,"wx", "微信");
    private final int code;
    private final String prefix;
    private final String message;
    PaymentType(int code,String prefix, String message) {
        this.code = code;
        this.prefix = prefix;
        this.message = message;
    }

    public String getPrefix() {
        return prefix;
    }

    public static PaymentType getPaymentType(int code) {
        for (PaymentType value : PaymentType.values()) {
            if (value.code == code) {
                return value;
            }
        }
        return null;
    }
}
